package de.homelabs.bookmarkmanager.desktop.qt.menu;

import com.trolltech.qt.core.QObject;
import com.trolltech.qt.gui.QAction;
import com.trolltech.qt.gui.QIcon;

/**
 * Extends the QAction class with more attributes for better handling.<br>
 * <br>
 * @author smirk
 *
 */
public class HAction extends QAction implements Comparable<HAction>{

	//vars
	private String actionKey = "";
	private int order;
	private String parentItem = "";
	
	/**
	 * contructor
	 * @param text
	 */
	public HAction(String text){
		super(text,null);
	}
	
	/**
	 * constructor
	 * @param text
	 * @param parent
	 */
	public HAction(String text, QObject parent) {
		super(text, parent);
		
	}
	
	/**
	 * constructor
	 * @param icon
	 * @param text
	 * @param parent
	 */
	public HAction(QIcon icon, String text, QObject parent) {
		super(icon, text, parent);
	}

	/**
	 * constructor
	 * @param parent
	 */
	public HAction(QObject parent) {
		super(parent);
	}

	/**
	 * constructor
	 * @param p
	 */
	public HAction(QPrivateConstructor p) {
		super(p);
	}

	/*******************
	 * getter / setter *
	 *******************/
	public String getActionKey() {
		return actionKey;
	}

	public void setActionKey(String actionKey) {
		this.actionKey = actionKey;
	}

	public int getOrder() {
		return order;
	}

	public void setOrder(int order) {
		this.order = order;
	}

	public String getParentItem() {
		return parentItem;
	}

	public void setParentItem(String parentItem) {
		this.parentItem = parentItem;
	}

	@Override
	public int compareTo(HAction o) {
		return Integer.valueOf(order).compareTo(Integer.valueOf(o.getOrder()));
	}

}
